generated_sources = [
    'Atk_ActionAdapter.cs',
    'Atk_AtkSharp.FocusHandlerNative.cs',
    'Atk_NoOpObjectFactory.cs',
    'Atk_TextRange.cs',
    'Atk_TextBoundary.cs',
    'Atk_GObjectAccessible.cs',
    'Atk_IText.cs',
    'Atk_AtkSharp.KeySnoopFuncNative.cs',
    'Atk_ChildrenChangedHandler.cs',
    'Atk_PropertyValues.cs',
    'Atk_RealStateSet.cs',
    'Atk_NoOpObject.cs',
    'Atk_Object.cs',
    'Atk_EventListener.cs',
    'Atk_Layer.cs',
    'Atk_IHyperlinkImpl.cs',
    'Atk_FocusTracker.cs',
    'Atk_Rectangle.cs',
    'Atk_Global.cs',
    'Atk_IValue.cs',
    'Atk_ImageAdapter.cs',
    'Atk_TextRectangle.cs',
    'Atk_KeySnoopFunc.cs',
    'Atk_WindowAdapter.cs',
    'Atk_ColumnDeletedHandler.cs',
    'Atk_Relation.cs',
    'Atk_RelationType.cs',
    'Atk_FocusHandler.cs',
    'Atk_RowDeletedHandler.cs',
    'Atk_StateSet.cs',
    'Atk_StreamableContentAdapter.cs',
    'Atk_StateType.cs',
    'Atk_Range.cs',
    'Atk_TextClipType.cs',
    'Atk_IImplementor.cs',
    'Atk_AtkSharp.EventListenerNative.cs',
    'Atk_ITable.cs',
    'Atk_LinkSelectedHandler.cs',
    'Atk_IDocument.cs',
    'Atk_TextAdapter.cs',
    'Atk_AtkSharp.PropertyChangeHandlerNative.cs',
    'Atk_ComponentAdapter.cs',
    'Atk_EditableTextAdapter.cs',
    'Atk_KeyEventType.cs',
    'Atk_TableAdapter.cs',
    'Atk_EventListenerInit.cs',
    'Atk_ImplementorAdapter.cs',
    'Atk_AtkSharp.FunctionNative.cs',
    'Atk_ISelection.cs',
    'Atk_Attribute.cs',
    'Atk_SelectionAdapter.cs',
    'Atk_TextChangedHandler.cs',
    'Atk_FocusEventHandler.cs',
    'Atk_TextCaretMovedHandler.cs',
    'Atk_Role.cs',
    'Atk_BoundsChangedHandler.cs',
    'Atk_ColumnInsertedHandler.cs',
    'Atk_IWindow.cs',
    'Atk_TextInsertHandler.cs',
    'Atk_PropertyChangeEventHandler.cs',
    'Atk_ValueChangedHandler.cs',
    'Atk_RelationSet.cs',
    'Atk_TextGranularity.cs',
    'Atk_Registry.cs',
    'Atk_HyperlinkImplAdapter.cs',
    'Atk_UtilListenerInfo.cs',
    'Atk_Socket.cs',
    'Atk_IEditableText.cs',
    'Atk_ITableCell.cs',
    'Atk_CoordType.cs',
    'Atk_TableCellAdapter.cs',
    'Atk_ValueType.cs',
    'Atk_TextAttribute.cs',
    'Atk_AtkSharp.EventListenerInitNative.cs',
    'Atk_ValueAdapter.cs',
    'Atk_Plug.cs',
    'Atk_StateChangeHandler.cs',
    'Atk_KeyEventStruct.cs',
    'Atk_Function.cs',
    'Atk_Misc.cs',
    'Atk_PageChangedHandler.cs',
    'Atk_IStreamableContent.cs',
    'Atk_DocumentAdapter.cs',
    'Atk_RowInsertedHandler.cs',
    'Atk_IImage.cs',
    'Atk_StateManager.cs',
    'Atk_Focus.cs',
    'Atk_HyperlinkStateFlags.cs',
    'Atk_Util.cs',
    'Atk_ObjectFactory.cs',
    'Atk_HypertextAdapter.cs',
    'Atk_Hyperlink.cs',
    'Atk_ActiveDescendantChangedHandler.cs',
    'Atk_IHypertext.cs',
    'Atk_IComponent.cs',
    'Atk_TextRemoveHandler.cs',
    'Atk_PropertyChangeHandler.cs',
    'Atk_IAction.cs',
]

run_target('update_' + pkg + '_code',
        command: [
            generate_api,
            '--api-raw', raw_api_fname,
            '--gapi-fixup', gapi_fixup.full_path(),
            '--metadata', metadata_fname,
            '--gapi-codegen', gapi_codegen.full_path(),
            '--extra-includes', glib_api_includes,
            '--out', meson.current_source_dir(),
            '--files', ';'.join(generated_sources),
            '--assembly-name', assembly_name,
            '--abi-includes', 'atk/atk.h',
            '--abi-cs-usings', 'Atk,GLib',
        ],
        depends: [gapi_codegen, gapi_fixup],)
pkgs += [pkg]
source_gen = files(generated_sources)
c_abi = files(assembly_name + '-abi.c')
cs_abi = files(assembly_name + '-abi.cs')

atk_api_includes = join_paths(meson.current_source_dir(), 'atk-api.xml')
if install
    install_data(atk_api_includes, install_dir: gapi_xml_installdir)
endif
